package cn.com.nes.site.entity.vo.equipment;

import cn.com.nes.site.entity.vo.PageVO;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.util.ArrayList;
import java.util.Date;
import java.util.List;

/**
 * 添加设备VO
 *
 * @Author: ShenWei
 * @Date: 2024/03/08/15:51
 */
@Data
@NoArgsConstructor
public class AddEquipmentVo extends PageVO {
    private String manufactureId;
    private Byte isAgent;
    private String xzqh;
    private String ddId;
    private String userId;
    private String name;
    private String phone;
    private String address;
    private Double jd;
    private Double wd;
    private boolean fromWorkOrder = false;
    private boolean createWorkOrder = false;
    private String workOrderId;
    private List<String> images = new ArrayList<>();
    private List<Equip> equips = new ArrayList<>();

    /**
     * 经销商名称
     */
    private String dealerName;

    /**
     * 经销商电话
     */
    private String dealerPhone;

    /**
     * 添加工单设备
     * @return
     */
    public static AddEquipmentVo addWorkOrderEquip(String manufactureId, Byte isAgent, String userId, String name, String phone, String address,
                                                   String sblxId, String xzqh, String sbxlh) {
        AddEquipmentVo vo = new AddEquipmentVo();
        vo.setManufactureId(manufactureId);
        vo.setIsAgent(isAgent);
        vo.setUserId(userId);
        vo.setName(name);
        vo.setPhone(phone);
        vo.setAddress(address);
        Equip equip = new Equip();
        equip.setSblxId(sblxId);
        equip.setEquipNo(sbxlh);
        vo.getEquips().add(equip);
        vo.setXzqh(xzqh);
        vo.setFromWorkOrder(true);
        return vo;
    }


    @Data
    @NoArgsConstructor
    public static class Equip {
        private String sbId;
        private String sblxId;
        private Date sbxlh;
        private String wxId;
        private String alias;
        private String equipNo;
        private String serialnumber;
    }
}
